<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

namespace app\agency\controller;

use app\agency\service\NodeService;
use app\common\facade\Arr;
use library\tools\Data;
use think\Db;

/**
 * 系统配置
 * Class User
 * @package app\admin\controller
 */
class Config extends AgentBase
{

    /**
     * 指定当前数据表
     * @var string
     */
    public $table = 'system_agent_user';

    /**
     * 审核人员名单
     * @auth true
     * @menu true
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\exception\PDOException
     */
    public function index()
    {
        $this->title = '审核人员名单';
        
        if ($this->request->isGet()) {

            //获取当前代理商所在城市
            $user=$this->agentUser;
            $this->assign('user',$user);

            $this->fetch();
        }else{

            $data=$this->request->post();
            $data1['id']=$data['id'];
            $data1['job_check_users']=$data['job_check_users'];
            $data1['market_check_users']=$data['market_check_users'];
            $data1['updated_at']=time();
            $result=DB::name($this->table)->update($data1);
            if($result){
                $this->success('操作成功');
            }else{
                $this->error('操作失败');
            }
            
        }
    }


}
